package com.qctpos.crm.webapi.controller;

import com.qctpos.crm.common.annotation.ResponseResult;
import com.qctpos.crm.common.annotation.UserLoginToken;
import com.qctpos.crm.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 本控制器基类  默认注入一个服务层  默认开启token验证
 * 强制返回 json格式  如果子控制器需要跳转视图  则不要继承本积累  如Logion 控制
 * @param <S>
 * @param <E>
 */
@Controller
@UserLoginToken //需要登录 验证token
@ResponseResult//自动封装成Result
public class BaseApiController<S extends BaseService<E>,E> {

    /*@Autowired
    protected S baseService;


    @UserLoginToken
    @DeleteMapping("/{id}")
    public  Void deleteById(@PathVariable("id") Long id) throws Exception {
        baseService.removeById((id));
        return  null;
    }*/
}
